home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 1 / include / config.h next >
Encoding:
C/C++ Source or Header  |  1985-07-26  |  4.5 KB  |  135 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* config.h - version 1.0.3 */
  3.  
  4. #ifndef CONFIG    /* make sure the compiler doesnt see the typedefs twice */
  5.  
  6. #define    CONFIG
  7. #define    UNIX        /* delete if no fork(), exec() available */
  8. #define    CHDIR        /* delete if no chdir() available */
  9.  
  10. /*
  11.  * Some include files are in a different place under SYSV
  12.  *     BSD           SYSV
  13.  * <strings.h>        <string.h>
  14.  * <sys/wait.h>        <wait.h>
  15.  * <sys/time.h>        <time.h>
  16.  * <sgtty.h>        <termio.h>
  17.  * Some routines are called differently
  18.  * index        strchr
  19.  * rindex        strrchr
  20.  * Also, the code for suspend and various ioctls is only given for BSD4.2
  21.  * (I do not have access to a SYSV system.)
  22.  */
  23. #define BSD        /* delete this line on System V */
  24.  
  25. /* #define STUPID */    /* avoid some complicated expressions if
  26.                your C compiler chokes on them */
  27. /* #define PYRAMID_BUG */    /* avoid a bug on the Pyramid */
  28. /* #define NOWAITINCLUDE */    /* neither <wait.h> nor <sys/wait.h> exists */
  29.  
  30. #define WIZARD  "aeb"    /* the person allowed to use the -D option */
  31. #define RECORD    "record"/* the file containing the list of topscorers */
  32. #define    NEWS    "news"    /* the file containing the latest hack news */
  33. #define    HELP    "help"    /* the file containing a description of the commands */
  34. #define    SHELP    "hh"    /* abbreviated form of the same */
  35. #define    RUMORFILE    "rumors"    /* a file with fortune cookies */
  36. #define    DATAFILE    "data"    /* a file giving the meaning of symbols used */
  37. #define    FMASK    0660    /* file creation mask */
  38. #define    HLOCK    "perm"    /* an empty file used for locking purposes */
  39. #define LLOCK    "safelock"    /* link to previous */
  40.  
  41. #ifdef UNIX
  42. /*
  43.  * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  44.  * If defined, it can be overridden by the environment variable PAGER.
  45.  * Hack will use its internal pager if DEF_PAGER is not defined.
  46.  * (This might be preferable for security reasons.)
  47.  * #define DEF_PAGER    ".../mydir/mypager"
  48.  */
  49.  
  50. /*
  51.  * If you define MAIL, then the player will be notified of new mail
  52.  * when it arrives. If you also define DEF_MAILREADER then this will
  53.  * be the default mail reader, and can be overridden by the environment
  54.  * variable MAILREADER; otherwise an internal pager will be used.
  55.  * A stat system call is done on the mailbox every MAILCKFREQ moves.
  56.  */
  57. #define    MAIL
  58. #define    DEF_MAILREADER    "/usr/ucb/mail"        /* or e.g. /bin/mail */
  59. #define    MAILCKFREQ    1
  60.  
  61.  
  62. #define SHELL        /* do not delete the '!' command */
  63.  
  64. #ifdef BSD
  65. #define    SUSPEND        /* let ^Z suspend the game */
  66. #endif BSD
  67. #endif UNIX
  68.  
  69. #ifdef CHDIR
  70. /*
  71.  * If you define HACKDIR, then this will be the default playground;
  72.  * otherwise it will be the current directory.
  73.  */
  74. #define HACKDIR    "/usr/games/lib/hackdir"
  75.  
  76. /*
  77.  * Some system administrators are stupid enough to make Hack suid root
  78.  * or suid daemon, where daemon has other powers besides that of reading or
  79.  * writing Hack files. In such cases one should be careful with chdir's
  80.  * since the user might create files in a directory of his choice.
  81.  * Of course SECURE is meaningful only if HACKDIR is defined.
  82.  */
  83. #define SECURE            /* do setuid(getuid()) after chdir() */
  84.  
  85. /*
  86.  * If it is desirable to limit the number of people that can play Hack
  87.  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  88.  * #define MAX_NR_OF_PLAYERS    6
  89.  */
  90. #endif CHDIR
  91.  
  92. /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
  93. #define    COLNO    80
  94. #define    ROWNO    22
  95.  
  96. /*
  97.  * small signed integers (8 bits suffice)
  98.  *    typedef    char    schar;
  99.  * will do when you have signed characters; otherwise use
  100.  *    typedef    short int schar;
  101.  */
  102. typedef    char    schar;
  103.  
  104. /*
  105.  * small unsigned integers (8 bits suffice - but 7 bits do not)
  106.  * - these are usually object types; be careful with inequalities! -
  107.  *    typedef    unsigned char    uchar;
  108.  * will be satisfactory if you have an "unsigned char" type; otherwise use
  109.  *    typedef unsigned short int uchar;
  110.  */
  111. typedef    unsigned char    uchar;
  112.  
  113. /*
  114.  * small integers in the range 0 - 127, usually coordinates
  115.  * although they are nonnegative they must not be declared unsigned
  116.  * since otherwise comparisons with signed quantities are done incorrectly
  117.  */
  118. typedef schar    xchar;
  119. typedef    xchar    boolean;        /* 0 or 1 */
  120. #define    TRUE    1
  121. #define    FALSE    0
  122.  
  123. /*
  124.  * Declaration of bitfields in various structs; if your C compiler
  125.  * doesnt handle bitfields well, e.g., if it is unable to initialize
  126.  * structs containing bitfields, then you might use
  127.  *    #define Bitfield(x,n)    uchar x
  128.  * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
  129.  */
  130. #define    Bitfield(x,n)    unsigned x:n
  131.  
  132. #define    SIZE(x)    (int)(sizeof(x) / sizeof(x[0]))
  133.  
  134. #endif CONFIG
  135.